//计数器reducer
export const countVal = (countVal=Number, action) => {
  switch (action.type) {
    case "INCREMENT":
      return countVal + 2
    case "DECREMENT":
      return countVal - 2
    default:
      return countVal;
  }
};

//nameList reducer
export const nameList = (nameList=Object, action) => {
  switch (action.type) {
    case "ADDNAME":
      return [...nameList,action.value]
    case "DELETENAME":
      let arr = [...nameList];
      arr.splice(action.value,1);
      return arr;
    default:
      return nameList;
  }
};
